package com.example.makerspace.controller;

import com.example.makerspace.dto.PageRequest;
import com.example.makerspace.dto.Result;
import com.example.makerspace.service.IntroductionService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/api/introduction")
@ResponseBody
public class IntroductionController {

    @Resource
    private IntroductionService introductionService;

    @PostMapping("/newsList")
    public Result newsList(@RequestBody PageRequest pageRequest){
        return introductionService.newsList(pageRequest);
    }
}
